#include <stdio.h>

int h, k;
int n[8][8] = {{1, 2, 3, 4, 5, 6, 7, 8}, 
		{2, 4, 8, 12, 16, 20, 26},
		{3, 7, 15, 24, 36, 52},
		{4, 10, 26, 44, 70},
		{5, 14, 35, 71}, 
		{6, 18, 52},
		{7, 23},
		{8}};
int result[8][8][8] = {{{1}, {1, 2}, {1, 2, 3}, {1, 2, 3, 4}, {1, 2, 3, 4, 5}, {1, 2, 3, 4, 5, 6}, {1, 2, 3, 4, 5, 6, 7}, {1, 2, 3, 4, 5, 6, 7, 8}}, 
			{{1}, {1, 2}, {1, 3, 4}, {1, 3, 5, 6}, {1, 3, 5, 7, 8}, {1, 2, 5, 8, 9, 10}, {1, 2, 5, 8, 11, 12, 13}}, 
			{{1}, {1, 3}, {1, 4, 5}, {1, 4, 7, 8}, {1, 4, 6, 14, 15}, {1, 3, 7, 9, 19, 24}},
			{{1}, {1, 3}, {1, 5, 8}, {1, 3, 11, 18}, {1, 3, 11, 15, 32}}, 
			{{1}, {1, 4}, {1, 6, 7}, {1, 4, 12, 21}}, 
			{{1}, {1, 4}, {1, 7, 12}}, 
			{{1}, {1, 5}}, 
			{{1}}};

int main()
{
	int i;
	while(scanf("%d%d", &h, &k), h || k)
	{
		if(h == 0 || k == 0)
			printf(" ->  0\n");
		else
		{
			for(i = 0; i < k; i++)
				printf("%3d", result[h-1][k-1][i]);
			printf(" ->%3d\n", n[h-1][k-1]);
		}
	}
	return 0;
}
